﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace test_6_17
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int[] arr = { 5, 3, 2, 4, 7, 8 };
            textBox1.Text = "初始数组：\n";
            foreach (int i in arr)
            {
                textBox1.Text += i+" ";
            }
            Array.Sort(arr);
            Array.Reverse(arr);
            textBox2.Text = "排序后数组：\n";
            foreach (int i in arr)
            {
                textBox2.Text += i + " ";
            }
        }
    }
}
